
{template header}
<div class="accwidth">
  {template ucenter_header}
  <div class="w1200 mt20">
    {template ucenter_left}
    <div class="account_right shadowBox">
      <div class="account_tab">
        <ul>
          <li><a href="{U('user/userinfo')}" class="l3 ">个人资料</a></li>
          <?php if ($this->userinfo['user_type'] ==2){ ?>
          <li><a href="{U('user/userInfocompany')}" class="l3 ">商家资料</a></li>
           <?php } ?>
          <li><a href="{U('user/avatar')}" class="l3 hoverff9f2e">头像设置</a></li>
          <li><a href="{U('user/security')}" class="l3 ">登录密码</a></li>
          <li><a href="{U('user/pinpass')}" class="l3 ">支付密码</a></li>
          <li><a href="{U('address/address')}" class="l3">收货地址</a></li>
        </ul>
      </div>
      <link rel="stylesheet" type="text/css" href="{THEME_PATH}css/user-style.css?v=1" />
<script type="text/javascript" src="{THEME_PATH}avatar/swfobject.js"></script> 
<script type="text/javascript" src="{THEME_PATH}avatar/fullAvatarEditor.js"></script> 
<script src="{JS_PATH}artDialog/artDialog.js" type="text/javascript"></script>
<style>
.head{width:100%;margin:0;padding:0;}
</style>
      <div class="touxss">
       <form action="" id="touxss_form" method="post">
 			<div>
            	<a href="javascript:;"  onclick="$('.upload_img').show();" class="a-upload">
                	本地照片
                </a>
            </div>
            <div class="uploadtips">支持JPG、GIF、PNG格式，文件小于5M。（使用高质量图片，可以生成高清头像）</div>
            <div class="touximg">
            	<span class="bigtouximg"><img src="{if $ico}{ROOT_PATH}uploadfile/avatar/<?php echo $this->userid; ?>_200.jpg{else}{THEME_PATH}images/bigtouximg.png{/if}"></span><span class="line"></span>
            	<span class="migtouximg"><img src="{if $ico}{ROOT_PATH}uploadfile/avatar/<?php echo $this->userid; ?>_200.jpg{else}{THEME_PATH}images/bigtouximg.png{/if}"></span>
                <span class="smaltouximg"><img src="{if $ico}{ROOT_PATH}uploadfile/avatar/<?php echo $this->userid; ?>_200.jpg{else}{THEME_PATH}images/bigtouximg.png{/if}"></span>
                <div class="txtip">
                	<ul>
                        <li>点击从电脑中选择上传您的会员头像</li>
                        <li>请勿在形象标识上留有任何联系方式的信息</li>
                        <li>支持JPG格式，图片大小不超过5M</li>
                        <li>请保证图片质量，头像尺寸至少为200*200px</li>
                        
                    </ul>
                 </div>
                  <div class="clear"></div>
            </div>
            <div></div>
       </form>

	   </div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<div class="upload_img" style="display: none;">
  <dl>
    <dt><strong>上传头像图片</strong><em><img src="{THEME_PATH}images/ico_close.png" onclick="$('.upload_img').hide();" /></em></dt>
    <dd>
      <p id="swfContainer">本组件需要安装Flash Player后才可使用，请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。</p>
    </dd>
  </dl>
</div>
<script type="text/javascript">
				var url ="<?php echo U('User/Upload/upload_user_avatar')?>";
				var swf_file = "<?php echo THEME_PATH.'avatar/fullAvatarEditor.swf'?>";
				swfobject.addDomLoadEvent(function() {
					var swf = new fullAvatarEditor("swfContainer",440,690, {
						id: 'swf',
						file : swf_file,
						//upload_url: './upload.php',
						method:'get',
						upload_url:url,
						avatar_sizes: "200*200|80*80|50*50",
						avatar_sizes_desc: "200*200像素|80*80像素|50*50像素",
						checkbox_visible:false,
						src_upload: 2
					}, function(msg) {
						switch(msg.code)
						{
							case 3 :
								if(msg.type == 0)
								{
									alert("摄像头已准备就绪且用户已允许使用。");
								}
								else if(msg.type == 1)
								{
									alert("摄像头已准备就绪但用户未允许使用！");
								}
								else
								{
									alert("摄像头被占用！");
								}
							break;
							case 5 : 
								if(msg.type == 0)
								{
									location.reload();
								}else{
									alert(msg.content.msg);
								}
							break;
						}
					});
				});
			</script>
{template footer}